﻿<%@ Page Title="Edit Member Page" Language="C#" MasterPageFile="  ~/template/Site.Master" AutoEventWireup="true" CodeBehind="EditMember.aspx.cs" Inherits="EAAdmin.EditMember" %>

<%@ Import Namespace="EA.DTO" %>
<%@ Import Namespace="EA.Common" %>

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    <form id="form1" runat="server" action="EditMember.aspx?action=Update">
        <div>
            <% 
                string userName = "";
                string fullName = "";
                int id = 0;
                int role = 0;
                DateTime lastLogOnDate = DateTime.Now;
                if (Attributes.ContainsKey("member"))
                {
                    MemberTO member = (MemberTO)Attributes["member"];
                    userName = member.UserName;
                    fullName = member.FullName;
                    role = member.Role;
                    lastLogOnDate = member.LastLogOnDate;
                    id = member.ID;
                }         
            %>
            <input type="hidden" name="id" value="<%=id %>" />
            <div class="page_name">Member Edition</div>
             <div class="error">
            <%                
                String alert = "";
                if (Attributes.ContainsKey("err"))
                {
                    alert = (String)Attributes["err"];
            %>
            <div class="message">
                <div><%=alert%></div>
            </div>
            <%  }
                if (Attributes.ContainsKey("success"))
                {
                    alert = (String)Attributes["success"];
            %>
            <div class="message_alert">
                <div><%=alert%></div>
            </div>
            <%  } %>
        </div>
            <table style="margin-left: 350px">
                <tr>
                    <td>User Name</td>
                    <td>:</td>
                    <td>
                        <input readonly="readonly" type="text" class="textbox" name="pUserName" id="pUserName"value="<%=userName%>" />
                    </td>
                </tr>
                <tr>
                    <td>Password</td>
                    <td>:</td>
                    <td>
                        <input type="password" class="textbox" name="pPassword" id="pPassword" />
                    </td>
                </tr>
                <tr>
                    <td>Full Name </td>
                    <td>:</td>
                    <td>
                        <input type="text" class="textbox" name="pFullName" id="pFullName" value="<%=fullName%>" />
                    </td>
                </tr>
                <tr>
                    <td>Role</td>
                    <td>:</td>
                    <td>
                        <select name="pRole">
                            <option value="1"
                                <%if (role == Constant.ROLE_PRODUCT)
                                  {%>
                                selected
                                <%} %>>Product Manager
                            </option>
                            <option value="2"
                                <%if (role == Constant.ROLE_CUSTOMER)
                                  {%>
                                selected
                                <%} %>>Customer Manager
                            </option>
                             <option value="3"
                                <%if (role == Constant.ROLE_MANAGER)
                                  {%>
                                selected
                                <%} %>>Manager
                            </option>
                        </select></td>
                </tr>
            </table>
            <div>
                <input type="submit" class="button" value="Update" />
            </div>
        </div>
    </form>
</asp:Content>
